﻿using NP.BPMReportPlatform.Entities.BPM_Business;
using System.Collections.Generic;
using System.Threading.Tasks;
using static NP.BPMReportPlatform.Performance.Dto.PerformanceDto;
using static NP.BPMReportPlatform.RecurringJobs.Dto.SFPerformDto;
using static NP.BPMReportPlatform.RecurringJobs.Dto.SFPerformDto.SFFormTitleResponse;

namespace NP.BPMReportPlatform.RecurringJobs
{
    /// <summary>
    /// 绩效考评SF同步
    /// </summary>
    public interface ISFPerformanceSyncJob
    {
        /// <summary>
        /// 定时同步待办
        /// </summary>
        /// <returns></returns>
        Task SyncCategoryData();

        Task<string> SyncToDoData();

        /// <summary>
        /// 定时获取待办 true:可以用 false：已作废，不能用
        /// </summary>
        /// <returns></returns>
        Task<bool> CheckToDoData(int todoEntryId);

        /// <summary>
        /// 更新表单数据，防止数据默默未插入成功
        /// </summary>
        /// <returns></returns>
        Task<string> UpdateFormData();

        /// <summary>
        /// 发送额外邮件
        /// </summary>
        /// <returns></returns>
        Task<string> SendExtarEmail();

        /// <summary>
        /// 审批
        /// </summary>
        /// <returns></returns>
        PerformanceEntity SaveScope(Sections data, int todoEntryId, out string token);

        /// <summary>
        /// 员工确认
        /// </summary>
        /// <returns></returns>
        PerformanceEntity SuggestScope(Sections data, int todoEntryId, out string token);

        /// <summary>
        /// 下一步
        /// </summary>
        /// <returns></returns>
        Task ApproveNext(PerformanceEntity entity, string token);

        /// <summary>
        /// 上一步
        /// </summary>
        /// <returns></returns>
        Task ApprovePrev(PerformanceEntity entity, string token);

        /// <summary>
        /// 根据工号获取历史绩效信息
        /// </summary>
        /// <returns></returns>
        Task<List<SFHistoryResponse.SFHistoryData>> GetHistoryData(string worknumber);

        /// <summary>
        /// 根据工号获取历史绩效信息
        /// </summary>
        /// <returns></returns>
        Task<PerformHistoryDto> GetHistoryDataDetail(string worknumber, int formDataId);

        /// <summary>
        /// 推送邮件，或催办
        /// </summary>
        void SendEmail(List<int> id);
    }
}
